﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Minestorm.Evolved.IoC
{
	public class ObjectFactoryProxy : IObjectFactory
	{
		private ObjectFactory _objectFactory;

		public ObjectFactoryProxy(ObjectFactory objectFactory)
		{
			_objectFactory = objectFactory;
		}

		public void RegisterConcreteType<I, C>()
			where I : class
			where C : class, I
		{
			_objectFactory.RegisterConcreteType<I, C>();
		}

		public void RegisterSingleton<I, C>()
			where I : class
			where C : class, I
		{
			_objectFactory.RegisterSingleton<I, C>();
		}

		public void RegisterSingleton<I, C>(C instance)
			where I : class
			where C : class, I
		{
			_objectFactory.RegisterSingleton<I, C>(instance);
		}

        public I InstanceOf<I>()
            where I : class
        {
            return _objectFactory.InstanceOf<I>();
        }

        public void Dispose()
        {
            _objectFactory.Dispose();
        }

		public void RegisterMany(Action<IObjectFactory> factory)
		{
			_objectFactory.RegisterMany(factory);
		}

		public Boolean IsTypeRegistered<I>()
			where I : class
		{
			return _objectFactory.IsTypeRegistered<I>();
		}
	}
}
